@extends('pc.v3.layouts.newapp')
@push('styles')
  <link rel="stylesheet" href="{{web_static('pc/v3/css/detail.min.css',true)}}"/>
  @if($house->trumpetFontFile)
    <style>
      @font-face {
          font-family: trumpet-font;
          src: url('//web.static.ishangzu.com/pc/v3/fonts/trumpet/{{$house->trumpetFontFile}}.eot');
          src: url('//web.static.ishangzu.com/pc/v3/fonts/trumpet/{{$house->trumpetFontFile}}.eot?#iefix') format('embedded-opentype'),
          url('//web.static.ishangzu.com/pc/v3/fonts/trumpet/{{$house->trumpetFontFile}}.woff') format('woff');
      }
      .trumpet-font {
          font-family: trumpet-font;
      }
    </style>
  @endif
@endpush
@section('content')
  <div class="container">
    <div class="crumbs"><i class="icon icon-maphome"></i>
      <div>{!!\Common\Helpers\PcView\BreadcrumbDetail::detail($url, $city, $house)!!}</div>
    </div>
  </div>
  <div class="house-info">
    @if($house->isRentedOut())<img src="{{web_static('pc/v3/assets/detail/end.svg')}}" class="sell-end"/>
    @endif
    <div class="house-img-c">
      <div class="house-info-name">
        <h1>{{str_limit($house->premName,16)}}</h1>
        <h3>{{str_limit($house->doorModelDescribing,60)}}</h3>
      </div>
      <div class="house-img"><img src="{{$house->image('@540w_360h_1c_1e')}}" alt="{{sprintf('%s真实房源图片,%s',$house->premName,$house->title)}}"/></div>
      <div class="house-img-nav"><a class="prev"><i class="icon icon-prev"></i></a>
        <div class="house-img-lists-c">
          <div class="house-img-lists">
            @foreach($house->images() as $src)<a class="house-img-item"><img src="{{$src}}@540w_360h_1c_1e" alt="{{sprintf('%s真实房源图片,%s',$house->premName,$house->title)}}"/></a>
            @endforeach
          </div>
        </div><a class="next"><i class="icon icon-next"></i></a>
      </div>
      <div class="img-nav-"></div>
    </div>
    <div class="house-info-c">
      <div class="house-info-wrap border-b">
        <p class="price">{{$house->currentPrice()}}<span>元/月</span>
          @if($house->isSpecialOfferHouse())
          <s>{{$house->originalPrice()}}元/月</s><a>特价优惠 @if($house->specialOfferDays() != -1)剩{{$house->specialOfferDays()}}天@endif</a>
          @endif<i class="icon icon-twocode"></i><i class="icon icon-share"></i>
          <ul data-tag="share_1" class="share-text bdsharebuttonbox">
            <li class="share-text-li"><span>分享</span></li>
            <li><a data-cmd="weixin" class="bds_weixin"></a>
              <h3>微信</h3>
            </li>
            <li><a data-cmd="tsina" class="bds_tsina"></a>
              <h3>微博</h3>
            </li>
          </ul>
          <div class="share-text-twocode"><img src="{{url($house->qrCodeImageUrl())}}"/>
            <h3>扫二维码打开房源</h3>
          </div></p>
        <div class="house-tag-lists">
          @php $apartmentTypeName = $house->getApartmentTypeName(); @endphp
          @if($apartmentTypeName)<span class="house-tag">{{$apartmentTypeName}}</span>
          @endif
          @php $rentalTypeShortName = $house->getRentalTypeShortName() @endphp
          @if(empty($rentalTypeShortName))<span class="house-tag">{{$house->getRentalTypeName()}}</span>
          @else<a href="{{$url->withPath(\Common\Define\Route\WebRoute::ZUFANG)->withPathSegment($rentalTypeShortName,2)->toString()}}"><span class="house-tag">{{$house->getRentalTypeName()}}</span></a>
          @endif
          @if($house->isSmartKeyHouse())<span class="house-tag">智能锁</span>
          @endif
          @if($house->isMetroHouse())<a href="{{$url->withPath(\Common\Define\Route\MobileRoute::ZUFANG)->withPathSegment('fs2ts6',2)->toString()}}"><span class="house-tag">地铁房</span></a>
          @endif
          @foreach($house->getSpecialTags() as $tag)<span class="house-tag">{{$tag}}</span>
          @endforeach
          @foreach($house->getTags() as $tag)
            @if(strpos($tag,'独卫'))<a href="{{$url->withPath(\Common\Define\Route\MobileRoute::ZUFANG)->withPathSegment('fs2ts5',2)->toString()}}"><span class="house-tag">{{$tag}}</span></a>
            @elseif(strpos($tag,'阳台'))<a href="{{$url->withPath(\Common\Define\Route\MobileRoute::ZUFANG)->withPathSegment('fs2ts1',2)->toString()}}"><span class="house-tag">{{$tag}}</span></a>
            @else<span class="house-tag">{{$tag}}</span>
            @endif
          @endforeach
        </div>
      </div>
      <div class="house-info-wrap border-b border-info-top">
        <div class="house-attr clearfix">
          <div class="house-attr-c">
            @php $houseTypeShortName = $house->getHouseTypeShortName() @endphp
            @if(empty($houseTypeShortName))
              <p>{{$house->getHouseLayout()}}</p>
            @else<a href="{{$url->withPath(\Common\Define\Route\WebRoute::ZUFANG)->withPathSegment($houseTypeShortName,2)->toString()}}">
                <p>{{$house->getHouseLayout()}}</p></a>
            @endif<span>{{$house->getHouseFloor()}}</span>
          </div>
          <div class="house-attr-c attr-center">
            <p>{{$house->getHouseSize('平米')}}</p><span>面积</span>
          </div>
          <div class="house-attr-c attr-right">
            @php $houseDirectionShortName = $house->getHouseDirectionShortName() @endphp
            @if(empty($houseDirectionShortName))
              <p>{{$house->getHouseDirection('朝')}}</p>
            @else<a href="{{$url->withPath(\Common\Define\Route\MobileRoute::ZUFANG)->withPathSegment($houseDirectionShortName,2)->toString()}}">
                <p>{{$house->getHouseDirection('朝')}}</p></a>
            @endif<span>{{$house->getFitmentTypeName()}}</span>
          </div>
        </div>
        <div class="row clearfix">
          <div class="cols310">
            <label>付款方式：</label>
            @if($house->isOwnHouse())<a class="bank-pay-dev">可支持分期月付</a>
            @endif
            @if($house->isOrdinaryHouse())<a>面议</a>
            @endif
          </div>
        </div>
        <div class="row clearfix">
          <div class="cols310 house-address-width">
            <label>小区地址：</label>
            <div title="{{$house->getHouseAddress()}}" class="house-address-name">{!!$house->getLimitAndLinkAddress($city, 32)!!}</div><a href="#viewMap"><i class="icon icon-city"></i></a>
          </div>
        </div>
        <div class="row clearfix">
          <div class="cols40">
            <label>小区信息：</label><span>@if(isset($house->buildDate) && !empty($house->buildDate)){{$house->buildDate}}年建 | @endif @if(isset($house->propertyUseName)){{$house->propertyUseName}}@endif</span>
          </div>
          <div>
            <label>房源编号：</label><span>{{$house->houseNum}}</span>
          </div>
        </div>
      </div>
      <div class="house-info-wrap">
        <div class="clearfix"><img src="{{web_static('pc/v3/assets/detail/avatar.png')}}" class="avatar"/>
          <div class="person-info">
            <p class="person-name">{{$house->contactPerson}}<span>{{$house->webManagerParentDepName}} - {{$house->webManagerDepName}}</span>
            </p>
            @if(!$house->isRentedOut())
              <p data-content="@foreach($house->getHouseWebCall() as $call){{$call}}@endforeach" class="person-intro"></p>
            @endif
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="house-info-bank">
    <div class="house-bank-content"><i title="关闭" class="bank-close"></i>
      <div class="title">什么是金融分期</div>
      <p>为了给广大爱上租租客更好的租房体验，爱上租牵手银行推出分期付款服务，帮助租客轻松实现房租月付。</p>
      <div class="house-bank-con"><a style="display:none" class="house-bank-link">联合银行</a><a class="house-bank-web active"> 网商银行</a></div>
      <div style="display:none" class="house-bank-text">
        <p>1、年龄18至60周岁，信用良好的中国公民，凭有效身份证，皆可申请。</p>
        <p>2、申请额度为《房屋租赁合同》中约定的分期金额，不少于1.2万元，且不高于10万元。</p>
        <p>3、金融分期期数为12期（月），租客承租期大于12个月，超出部分费用，在本合同生效届满一年时，提前15天按季度支付。</p>
        <p>4、适用城市：杭州。</p>
      </div>
      <div class="house-bank-textweb">
        <p>1、凡持第二代有效身份证的中国公民，凭实名认证的支付宝账户申请，且在阿里体系无不良信用记录，无有效的授信额度，即可申请。</p>
        <p>2、申请额度为《房屋租赁合同》中约定的分期金额，不少于1.2万元，且不高于5万元。</p>
        <p>3、金融分期期数为12期（月），租客承租期大于12个月，超出部分费用，在本合同生效届满一年时，提前15天按季度支付。</p>
        <p>4、适用城市：上海、南京、苏州、杭州。</p>
      </div>
      <div class="house-bank-flow">
        <h3>办理流程</h3><a>签定租房协议<i class="icon icon-arrow"></i></a><a>线上申请贷款<i class="icon icon-arrow"></i></a><a>支付相关费用<i class="icon icon-arrow"></i></a><a class="bank-flow-margin">每月按期还款</a>
      </div>
    </div>
  </div>
  <div class="container">
    <div class="house-wrap house-describe">
      <div class="describe-box border-b">
        <h5>基本信息</h5>
        @if(empty($house->positionDescription) && empty($house->doorModelDescribing) && empty($house->agentDescription))
        <p class="clearfix"><span>中国首家互联网+公寓运营商爱上租成立于2015年8月，由原我爱我家联合创始人、盛世管家创始人童浩创立于杭州，致力于让居住简单有趣，让物业安全增值。成立之初，爱上租以做中国最大的公寓运营商的姿态在杭州连续收购了盛世管家和蜗居品牌公寓。</span><span>目前爱上租已完成A轮融资，并已斥资数亿元在杭州实行满城计划。2016年爱上租以杭州为总部正式进军上海、南京、苏州、深圳、宁波市场。爱上租计划将在10年内进入其它一二线城市,管理公寓超过800万套,成为中国最大的租赁B2C交易、资产管理、租客服务和社交平台。</span><span>爱上租品牌公寓产品的顾问团队包括日本著名建筑大师石山修武，日本房屋改造第一人松村秀一，无印良品（MUJI）创意顾问小池一子等。</span></p>
        @else
        @if(!empty($house->doorModelDescribing))
        <p class="clearfix">
          <label>房屋描述：</label><span class="describe-box-w">{{str_limit($house->doorModelDescribing,300)}}</span>
        </p>
        @endif
        @if(!empty($house->positionDescription))
        <p class="clearfix">
          <label>小区/周边：</label><span style="float:none" class="describe-box-w"> {{str_limit($house->positionDescription,300)}}</span>
        </p>
        @endif
        @if(!empty($house->agentDescription))
        <p class="clearfix">
          <label>管家说：</label><span class="describe-box-w">{{str_limit($house->agentDescription,300)}}</span>
        </p>
        @endif
        @endif
      </div>
      @if(is_array($house->equipments))
      <div class="describe-box border-b describe-box-icon">
        <h5>配置信息</h5>
        <p class="clearfix house-wrap-bottom"><span class="clearfix-house-icon">
            @foreach($house->equipments as $item)<span class="gear-item @if($loop->iteration % 10 == 0) gear-item-none  @endif @if($loop->index > 9) gear-item-margin  @endif"><img src="{{$item->url}}" alt="{{$item->name}}"/><em class="gear-text">@if($item->name == '燃气灶/电磁炉'){{'灶具'}}@else{{$item->name}}@endif</em></span>
            @endforeach</span></p>
        @if(count($house->equipments) > 10)
        <div class="gear-item-text"><em class="gear-text">展开</em></div>
        @endif
      </div>
      @endif
      @if($house->isOwnHouse())
      <div class="describe-box">
        <h5>房屋特征</h5>
        @foreach($house->getHouseFeature() as $item)<span class="etykiety">{{$item}}</span>
        @endforeach
      </div>
      @endif
    </div>
    @if($house->isShareHouse() && isset($house->roommates) && is_array($house->roommates) && count($house->roommates) > 0)
    <div class="house-wrap house-friend">
      <div class="title">
        <h2>合租房间</h2><span>（{{intval($house->rooms)}}室{{intval($house->hall)}}厅/{{intval($house->totalSize)}}平方）</span>
      </div>
      <div class="table">
        <table>
          <thead>
            <tr>
              <th style="width:95px;">房间号</th>
              <th style="width:131px;padding-left:20px;">面积</th>
              <th style="width:131px;">朝向</th>
              <th style="width:132px;">状态</th>
              <th style="width:132px;">特色</th>
              <th style="width:131px;">租客</th>
              <th style="width:164px;">价格</th>
            </tr>
          </thead>
          <tbody>
            <tr class="tr-padding"></tr>
            @foreach ($house->roommates as $item)
            @php $item = Common\Standard\Object\stdHouse::instance($item); @endphp
            <tr class="data @if(\Common\Helpers\PcView\Roommate::isRentedOut($item)) d-nohouse @endif">
              <td>{{$item->roomNo}}
                @if(\Common\Helpers\PcView\Roommate::isCurrentRoom($house,$item))<a class="mess-village-nameerr">本房间</a>
                @endif
              </td>
              <td class="pl_20">{{$item->size}}㎡</td>
              <td>{{$item->direction}}</td>
              <td>{{\Common\Helpers\PcView\Roommate::RentStatus($item)}}</td>
              <td>{{\Common\Helpers\PcView\Roommate::tags($item)}}</td>
              <td>{{\Common\Helpers\PcView\Roommate::gender($item)}}</td>
              <td class="no-data">{!!\Common\Helpers\PcView\Roommate::price($house,$item)!!}</td>
            </tr>
            @endforeach
          </tbody>
        </table>
      </div>
    </div>
    @endif
    <div class="house-wrap house-map">
      <h5 id="viewMap">周边配套</h5>
      <div class="clearfix">
        <div class="left">
          <div id="houseMap" style="width:100%;height:516px"></div>
          <div class="map-list">
            <p class="map-list-title"><a class="list-title-zero active">周边</a><a class="list-title-bus">公交</a></p><a class="map-item active">地铁</a><a class="map-item">公交站</a><a class="map-item">学校</a><a class="map-item">医院</a><a class="map-item">休闲娱乐</a><a class="map-item">银行</a><a class="map-item">餐饮</a><a class="map-item">购物商城</a><a class="map-item">超市</a><a class="map-item-input">
              <div class="map-item-change"><i class="icon icon-direction"></i></div>
              <div class="map-item-inputcent">
                <div class="input-start"><i class="icon icon-city"></i>
                  <input type="text" placeholder="起点" id="busStart" value="{{$house->premName}}"/>
                </div>
                <div class="input-end"><i class="icon icon-city"></i>
                  <input type="text" placeholder="终点" id="busTerminal"/>
                </div>
              </div>
              <div id="btnBusSearch" class="map-item-sure">
                <div>搜</div>
                <div class="sure-margin">索</div>
              </div></a>
          </div>
          <div class="map-list-con">
            <div id="mapRender" class="map-list-borer"></div>
          </div>
        </div>
        <div class="right">
          <div id="map-content"></div>
        </div>
      </div>
    </div>
    @php $recommendHouses = null; @endphp
    @if($house->isShareHouse() && isset($house->ambitusRooms))
      @php $recommendHouses = $house->ambitusRooms; @endphp
    @endif
    @if($house->isEntireHouse() && isset($house->ambitusHouses))
      @php $recommendHouses = $house->ambitusHouses; @endphp
    @endif
    @if(is_array($recommendHouses) && count($recommendHouses) > 0)
    <div class="house-refer">
      <div class="refer-header">
        <h2>推荐房源</h2>
        <p>精选优质房源，经过严格审核，实拍房源照片，居住安全可靠</p>
        <div class="house-panel">
          <div class="refer-pagination"><a class="prev enable"><i class="icon icon-prev"></i></a><a class="next"><i class="icon icon-next"></i></a></div>
          <div class="house-header">
            <h4 class="house-title">1</h4><span>/</span><span></span>
          </div>
        </div>
      </div>
      <div class="refer-content">
        <div class="refer-container">
          <div class="refer-lists">
            @foreach ($recommendHouses as $item)
            @php $item = Common\Standard\Object\stdHouse::instance($item); @endphp<a href="{{$item->url()}}" title="{{$item->premName}}" class="refer-list">
                <div class="refer-img"><img src="{{$item->image("@265w_198h_1c_1e")}}" alt="{{$item->premName}}"/>
                  @if($item->isSpecialOfferHouse())<i class="low-price"></i>
                  @endif
                </div>
                <div class="refer-info bgfafafa">
                  <p class="house-price"><span>{{$item->currentPrice()}}元/月</span><i class="house-name">{{$item->premName}}</i></p>
                  <p class="refer-tag">{{$item->getHouseSize()}} | {{$item->getHouseFloor()}} | {{$item->getHouseLayout()}} | {{$item->getFitmentTypeName()}}</p>
                </div></a>
            @endforeach
          </div>
        </div>
      </div>
    </div>
    @endif
  </div>
@endsection
@section('footer')
  <!-- div.detail-container -->
  <!-- include ../components/search/common -->
  @parent
@endsection
@push('scripts')
  <script>
    window._bd_share_config = {
        common: {
            bdSign: 'off',//on｜off｜normal
            bdText: '【{{$house->premName}}】{{$house->districtName}}-{{$house->bizCircleName}}，{{$house->getRentalTypeName()}} {{$house->currentPrice()}}元/月,{{$house->getHouseSize("平米")}}，{{$house->getHouseLayout()}}，{{$house->getHouseDirection()}}',
            bdDesc: '',
            bdUrl: '{{url($house->url())}}',
            bdPic: '{{$house->image()}}'
        },
        share: [{
            "tag": "share_1",
            "bdSize": 32
        }]
    }
    with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion=' + ~(-new Date() / 36e5)];
  </script>
  <script>
    var houseConfig = {
        id: '{{$house->id}}',
        name: '{{$house->premName}}',
        title: '{{$house->title}}',
        lng: '{{$house->longitude}}',
        lat: '{{$house->latitude}}',
        trump: '{{$house->trumpetFontFileAndApartmentId}}'
    };
  </script>
  <script>
    var iszConfig = {
        city_id: '{{$city->area_code}}',
        city_name: '{{$city->name}}',
        city_abbr: '{{$city->identifier}}',
        city_lng: '{{$city->lng}}',
        city_lat: '{{$city->lat}}',
        channel:'{{$url->getSegment(1)}}',
    };
  </script>
  <script src="//webapi.amap.com/maps?v=1.3&amp;key=41aa4b3719e2d80aa72b27a6615cf526"></script>
  <script src="{{web_static('pc/v3/js/detail.min.js',true)}}"></script>
@endpush